﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using SAR.Pages;

namespace SAR
{
    public partial class ChengXiangChuLi1 : BasePageClass, PageWithParent
	{
		public ChengXiangChuLi1()
		{
			this.InitializeComponent();
            
			// 在此点之下插入创建对象所需的代码。
		}

        #region BasePageClass Members

        public bool PreClick()
        {
            return true;
        }

        public bool NextClick()
        {
            return true;
        }

        //父亲引用
        private ChengXiangChuLiPageControl parentCtr;

        //判断模式
        public void SetParent(Page parent)
        {
            this.parentCtr = parent as ChengXiangChuLiPageControl;
            if (parentCtr.ModelType == 0)
            {
                this.model1Grid.Visibility = Visibility.Visible;
                this.model2Grid.Visibility = Visibility.Hidden;
            }
            else
            {
                this.model1Grid.Visibility = Visibility.Hidden;
                this.model2Grid.Visibility = Visibility.Visible;
            }
        }

        //标签切换事件
        private void tab2_SARClick(object sender, MouseButtonEventArgs e)
        {
            this.tab2.SARIsSelected = true;
            this.tab1.SARIsSelected = false;

            this.grid2.Visibility = Visibility.Visible;
            this.grid1.Visibility = Visibility.Hidden;
        }

        private void tab1_SARClick(object sender, MouseButtonEventArgs e)
        {
            this.tab1.SARIsSelected = true;
            this.tab2.SARIsSelected = false;
            this.grid1.Visibility = Visibility.Visible;
            this.grid2.Visibility = Visibility.Hidden;
        }


        private void p1Grid2Head_SARClick(object sender, MouseButtonEventArgs e)
        {
            if (p1Grid2Head.SARIsUnfolded)
            {
                p1Grid2Head.SARIsUnfolded = false;
                p1Grid2.Visibility = Visibility.Collapsed;
                p1Grid1.Visibility = Visibility.Visible;
            }
            else
            {
                p1Grid2Head.SARIsUnfolded = true;
                p1Grid2.Visibility = Visibility.Visible;
                p1Grid1.Visibility = Visibility.Collapsed;
            }
        }




        #endregion
    }
}